@isTest
private class iFulfillAssignPriorityIndexTest{    


     static testMethod void AssignPriorityIndex(){
   
        Profile p = [select id from profile where name='System Administrator'];                     
        User u = new User(alias = 'ipsys', email='isadmin@accenture.com',emailencodingkey='UTF-8', lastname='TestUser', languagelocalekey='en_US',localesidkey='en_US', profileid = p.Id,timezonesidkey='Asia/Calcutta', username='ifulfilladmin@testorg.com');          
        Insert u;

     
        list<Fullfilment_Item__c> newFItems = new List <Fullfilment_Item__c>();
        List <ifullfill_Priority_Index__c> priorityIndexList = new List<ifullfill_Priority_Index__c>();                         
                                      
       ifullfill_Priority_Index__c IP1 = new ifullfill_Priority_Index__c();
       IP1.Product_Family__c='Audio';
       priorityIndexList.add(IP1);          
       ifullfill_Priority_Index__c IP2 = new ifullfill_Priority_Index__c();
       IP2.Product_Family__c='Real Website';
       priorityIndexList.add(IP2);              
       ifullfill_Priority_Index__c IP3 = new ifullfill_Priority_Index__c();
       IP3.Product_Family__c='Basic Website';
       priorityIndexList.add(IP3);
       system.runAs(u){
       insert priorityIndexList;}
       
       Fullfilment_Item__c FI1 = new Fullfilment_Item__c(Main_Listing_Phone_Number__c = '100',Listed_Name__c ='XYZ',Heading_Name__c ='Heading name',Item_Id__c = 'Item id' ,Product_Code__c ='p1',UDAC__c ='Udac1',Region__c = 'region1',Transaction_Type__c ='New');       
        FI1.Product_Family__c='Audio';
        newFItems.add(FI1);
            
        Fullfilment_Item__c FI2 =  new Fullfilment_Item__c(Main_Listing_Phone_Number__c = '101',Listed_Name__c ='XYZ1',Heading_Name__c ='Heading name1',Item_Id__c = 'Item id' ,Product_Code__c ='p2',UDAC__c ='Udac2',Region__c = 'region2',Transaction_Type__c ='New');        
        newFItems.add(FI2);                
        Fullfilment_Item__c FI3 =  new Fullfilment_Item__c(Main_Listing_Phone_Number__c = '102',Listed_Name__c ='XYZ2',Heading_Name__c ='Heading name2',Item_Id__c = 'Item id' ,Product_Code__c ='p3',UDAC__c ='Udac3',Region__c = 'region3',Transaction_Type__c ='New');           
        FI3.Product_Family__c='Basic Website';
        newFItems.add(FI3);
       system.runAs(u){
       insert newFItems;
       }
       
                         
     }
           
     
}